package com.lds.config.center.server.business.itemchange.converter;

import com.lds.config.center.common.model.itemchange.response.ItemChangeBaseResponse;
import com.lds.config.center.server.business.itemchange.entity.ItemChange;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;


@Component
public class ItemChangeToBaseResponseConverter implements Converter<ItemChange, ItemChangeBaseResponse> {

    @Override
    public ItemChangeBaseResponse convert(ItemChange source) {
        return ItemChangeBaseResponse.builder()
                .id(source.getId())
                .name(source.getName())
                .value(source.getValue())
                .valueType(source.getValueType())
                .desc(source.getDesc())
                .lineNum(source.getLineNum())
                .creator(source.getCreator())
                .modifier(source.getModifier())
                .createTime(source.getCreateTime())
                .updateTime(source.getUpdateTime())
                .namespaceId(source.getNamespaceId())
                .type(source.getType())
                .build();
    }

}


